<template>
	<div>
		<el-form :model="form.editProductHotCompany" label-width="100px">
			<el-form-item label="企业">
				<el-select v-model="form.editProductHotCompany.id" placeholder="企业选择">
				    <el-option v-for="item in initData.hotCompanyList" :key="item.value" :label="item.label" :value="item.value"></el-option>
			    </el-select>
			</el-form-item>

			<el-form-item label="标签">
				<el-select v-model="form.editProductHotCompany.tags" multiple :multiple-limit="6" placeholder="标签选择">
				    <el-option v-for="item in initData.tagsList" :key="item.value" :label="item.label" :value="item.value"></el-option>
			    </el-select>

			</el-form-item>

			<el-form-item label="描述">
				<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入内容" v-model="form.editProductHotCompany.desc">
				</el-input>
			</el-form-item>
		</el-form>

		<div style="margin-top:20px;text-align:center">
        	<el-form>
				<el-form-item>
					<el-button type="warning" @click="closeDialog">取消</el-button>
					<el-button type="primary" @click="dialogBtnOk">提交</el-button>
				</el-form-item>
        	</el-form>
        </div>
	</div>
</template>

<script>

export default{
	props:['rowInfo'],
	data(){
		return{
			form:{
				editProductHotCompany:{
					id:'',
					tags:[],
					desc:''
				}
			},
			initData:{
				hotCompanyList:[],
				tagsList:[]
			}
		}
	},
	mounted(){
		this.form.editProductHotCompany.id = this.rowInfo.id
		this.form.editProductHotCompany.tags = this.rowInfo.tags
		this.form.editProductHotCompany.desc = this.rowInfo.desc
		this.initData.hotCompanyList = 
	   	[
	   		{value: '1',label: '公司1'}, 
        	{value: '2',label: '公司2'}
	   	]
	   	this.initData.tagsList = 
	   	[
	   		{value: '3',label: '标签1'}, 
        	{value: '4',label: '标签2'}
	   	]
	},
	methods:{
		closeDialog(){
			this.$emit('closeDialog')
		},
		dialogBtnOk(){
			this.$emit('editProductHotCompanyInfo',this.form.editProductHotCompany)
			this.closeDialog()
		}
	}
}
</script>